import request from '@/utils/request.js'

export function fetchMovies(params) {
  return request.get('/movies', { params })
}

export function fetchMovie(id) {
  return request.get(`/movies/${id}`)
}

export function createMovie(data) {
  return request.post('/movies', data)
}

export function updateMovie(id, data) {
  return request.put(`/movies/${id}`, data)
}

export function deleteMovie(id) {
  return request.delete(`/movies/${id}`)
}